package string;

import java.util.Scanner;
//遍历字符串，键盘录入的字符串
//public char charAt(int index):根据索引返回字符
//public int length():返回字符串长度
public class Str4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String str = sc.next();
        //遍历
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            System.out.println(c);
        }
    }

}


